package cn.edu.thu.thss.algorithm.structures;

import java.util.ArrayList;
import java.util.List;

public final class TreeNode<K extends Comparable<K>, V> {
	private K key;
	private V value;
	private List<TreeNode<K, V>> children;
	private TreeNode<K, V> parent;
	
	public TreeNode(K key, V value) {
		this.key = key;
		this.value = value;
		children = new ArrayList<TreeNode<K, V>>();
	}
	
	public K getKey() {
		return key;
	}
	
	public V getValue() {
		return value;
	}
	
	public void setValue(V value) {
		this.value = value;
	}

	public List<TreeNode<K, V>> getChildren() {
		return children;
	}
	
	void setChildren(List<TreeNode<K, V>> children) {
		this.children = children;
	}
	
	void setKey(K key) {
		this.key = key;
	}
	
	public TreeNode<K, V> getParent() {
		return parent;
	}
	
	void setParent(TreeNode<K, V> parent) {
		this.parent = parent;
	}
}
